﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ExpensesService.aspx.cs"
    Inherits="ExpensesService" Debug="true" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function pageLoad(sender, args) {
                setInterval("WebServiceExpenses.GetExpensesData(updateGrid)", 5000);
            }
            function updateGrid(result) {
                var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                tableView.set_dataSource(result);
                tableView.dataBind();
            }
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Services>
                <asp:ServiceReference Path="~/WebServiceExpenses.asmx" />
            </Services>
        </asp:ScriptManager>
        <%-- <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
            <AjaxSettings>
                <%-- <telerik:AjaxSetting AjaxControlID="Timer1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="RadInputManager1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>--%>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="10"
            BackColor="White" InitialDelayTime="500">
            <asp:Image ID="Image1" Style="margin-top: 10px" runat="server" ImageUrl="~/loading.gif"
                BorderWidth="0px" AlternateText="Loading"></asp:Image>
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid runat="server" ID="RadGrid1"  AutoGenerateColumns="false" Skin="Vista">
            <MasterTableView TableLayout="Fixed">
                <Columns>
                    <telerik:GridBoundColumn DataField="ExpID" HeaderText="Exp ID" />
                    <telerik:GridBoundColumn DataField="Category" HeaderText="Category" />
                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" />
                    <telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" DataFormatString="{0:c}" />
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnCommand="function(){}" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
